package com.taysear.parcel.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="route_detail")
public class RouteDetail implements Serializable{

	@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="route")
	private Route route;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="substation")
	private Substation substation;
	private Boolean isStartEnd;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Route getRoute() {
		return route;
	}
	public void setRoute(Route route) {
		this.route = route;
	}
	public Substation getSubstation() {
		return substation;
	}
	public void setSubstation(Substation substation) {
		this.substation = substation;
	}
	public Boolean getIsStartEnd() {
		return isStartEnd;
	}
	public void setIsStartEnd(Boolean isStartEnd) {
		this.isStartEnd = isStartEnd;
	}
	@Override
	public String toString() {
		return substation.getName();
	}
}
